package eraserhead.controller;

import eraserhead.boundary.LoginForm;
import eraserhead.boundary.WelcomeForm;
import eraserhead.entity.Decision;

/**
 * Controller for the Welcome Form
 * @author QQ
 */
public class WelcomeFormController {

	// have access to main GUI
	WelcomeForm welcomeForm;
	LoginForm lf;
	
	/**
	 * Create a new {@link WelcomeFormController}
	 * @param welcomeForm {@link WelcomeForm} to control
	 */
	public WelcomeFormController(WelcomeForm welcomeForm){
		this.welcomeForm = welcomeForm;	
	}
	
	/**
	 * Creates a {@link Decision} event and disposes the {@link WelcomeForm}
	 */
	public void createEvent(){
		lf = new LoginForm(true);
		lf.setVisible(true);
		welcomeForm.dispose();
	}
	
	/**
	 * Joins a {@link Decision} and disposes the {@link WelcomeForm}
	 */
	public void joinEvent(){
		lf = new LoginForm(false);
		lf.setVisible(true);
		welcomeForm.dispose();
	}
	
}
